﻿using System;
using System.Windows.Forms;
using Grasp.DbEntityGenerator.Utils;
using Microsoft.Data.ConnectionUI;
using Microsoft.Data.ConnectionUI.MySql;

namespace Grasp.DbEntityGenerator.Tools
{
    public partial class SqlSettingForm : Form
    {
        public SqlSettingForm()
        {
            InitializeComponent();
        }

        private void SelectDataConnectionClick(object sender, System.EventArgs e)
        {
            try
            {
                var dcd = new DataConnectionDialog();
                var dcs = new DataConnectionConfiguration(null);
                dcs.LoadConfiguration(dcd);
                if (DataConnectionDialog.Show(dcd) == DialogResult.OK)
                {
                    MessageBox.Show(dcd.ConnectionString);

                }
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
        }
    }
}
